<?php
//图片素材
$this->group(['domain' => env('DOMAIN_ADMIN'),'prefix' => '/wechat/manager/material/'], function() {
    $this->get('view/image/{id}', 'Manager\Material\ImageController@getOne')->where('id','[0-9]+');
	//列表
    $this->get('view/image/list', 'Manager\Material\ImageController@getLists');	
    //上传
    $this->post('update/image', 'Manager\Material\ImageController@uploadPic');
    //更新图片信息
    $this->post('update/image/info', 'Manager\Material\ImageController@updateInfo');
    //图片移动分组
    $this->post('update/image/move', 'Manager\Material\ImageController@moveImage');
    //删除微信图片
    $this->delete('delete/image', 'Manager\Material\ImageController@deleteImage');    
});

// //图片分组
$this->group(['domain' => env('DOMAIN_ADMIN'),'prefix' => '/wechat/manager/material/'], function() {
	//更新分组名
    $this->post('update/imagegroup/', 'Manager\Material\ImageGroupController@updateOne');

    //图片分组
    $this->get('view/imagegroup/all', 'Manager\Material\ImageGroupController@getGroups');

    //获取所有分组,不包含:全部图片、未分组
    $this->get('view/imagegroup/all/single', 'Manager\Material\ImageGroupController@getAllSingle');

    $this->get('view/imagegroup/check', 'Manager\Material\ImageGroupController@checkGroup');

    //删除图片分组
    $this->delete('delete/imagegroup/{id}', 'Manager\Material\ImageGroupController@deleteGroup')->where('id','[0-9]+');
});

// //图文消息
$this->group(['domain' => env('DOMAIN_ADMIN'),'prefix' => '/wechat/manager/material/'], function() {
    $this->get('view/mpnews/{id}', 'Manager\Material\MpnewsController@getOne')->where('id','[0-9]+');

    //获取列表
    $this->get('view/mpnews/list', 'Manager\Material\MpnewsController@getLists');
	//更新分组名
    $this->post('update/mpnews', 'Manager\Material\MpnewsController@updateMpnews');

    $this->delete('delete/mpnews/{id}', 'Manager\Material\MpnewsController@deleteOne')->where('id','[0-9]+');

    $this->delete('delete/mpnews/news/', 'Manager\Material\MpnewsController@deleteNews');
});

// //文本消息
$this->group(['domain' => env('DOMAIN_ADMIN'),'prefix' => '/wechat/manager/material/'], function() {
    $this->get('view/text/{id}', 'Manager\Material\TextController@getOne')->where('id','[0-9]+');

    //获取列表
    $this->get('view/text/list', 'Manager\Material\TextController@getLists');
    //更新文本
    $this->post('update/text/', 'Manager\Material\TextController@updateText');

    $this->delete('delete/text/{id}', 'Manager\Material\TextController@deleteOne')->where('id','[0-9]+');
});